package com.zhyl.zhyl_detect_demo.viewmodel;

import android.app.Application;

import androidx.annotation.NonNull;
import androidx.lifecycle.AndroidViewModel;
import androidx.lifecycle.MutableLiveData;

import com.zhyl.detectibrary.util.DetectItem;

import java.util.ArrayList;
import java.util.List;

public class MainViewModel extends AndroidViewModel {
    private MutableLiveData<List<DetectItem>> results = new MutableLiveData<>(new ArrayList<>());
    private MutableLiveData<Long> inferenceTime = new MutableLiveData<>(0L);

    public MainViewModel(@NonNull Application application) {
        super(application);
    }

    public MutableLiveData<List<DetectItem>> getResults() {
        return results;
    }

    public void setResults(List<DetectItem> results) {
        this.results.postValue(results);
    }

    public MutableLiveData<Long> getInferenceTime() {
        return inferenceTime;
    }

    public void setInferenceTime(Long inferenceTime) {
        this.inferenceTime.postValue(inferenceTime);
    }
}
